using System;
using System.Collections;

namespace ACEMPortal.PCMManager.BusinessLogicLayer
{
	//*********************************************************************
	//
	// SelectionValue Class
	// this class support PCM Manager to assembly a single value to add to
	// a DropDolwList witch contains values to select ina aproduct configuration
	//
	//*********************************************************************
	public class SelectionValue
	{
		/** PRIVATE FIELDS **/

		private string				_Id;
		private string				_Text;

		/** CONSTRUCTORS **/

		public SelectionValue(){}

		public SelectionValue(
			string Id,
			string Text
			)
		{
			_Id = Id;
			_Text = Text;
		}

		/** PROPERTIES **/

		public string Id
		{
			get{ return _Id; }
			set{ _Id = value; }
		}
		
		public string Text
		{
			get{ return _Text; }
			set{ _Text = value; }
		}

		/** INSTANCE METHODS **/
	}

	//*********************************************************************
	//
	// SelectionValuesCollection Class ia acollection of SelectionValues
	//
	//*********************************************************************
	public class SelectionValuesCollection : CollectionBase
	{
		public SelectionValuesCollection()
		{
		}

		/** COLLECTION METHODS **/

		public SelectionValue this[ int index ] 
		{
			get  { return( (SelectionValue) List[index] );}
			set  { List[index] = value;}
		}

		public int Add( SelectionValue value ) 
		{
			return( List.Add( value ) );
		}

		public int IndexOf( SelectionValue value ) 
		{
			return( List.IndexOf( value ) );
		}

		public void Insert( int index, SelectionValue value ) 
		{
			List.Insert( index, value );
		}

		public void Remove( SelectionValue value ) 
		{
			List.Remove( value );
		}

		public bool Contains( SelectionValue value ) 
		{
			// If value is not of type SelectionValue, this will return false.
			return( List.Contains( value ) );
		}
	}
}
